export default {
  state: {
    asyncRoutes: [],
  },
  getters: {
    getAsyncRoutes: (state) => {
      return JSON.parse(sessionStorage.getItem("asyncRoutes")) || state.asyncRoutes;
    },
  },
  mutations: {
    setAsyncRoutes(state, payload) {
      state.asyncRoutes = payload;
      sessionStorage.setItem("asyncRoutes", JSON.stringify(state.asyncRoutes));
    },
  },
  actions: {
    setAsyncRoutes(state, payload) {
      state.commit("setAsyncRoutes", payload);
    },
  },
};
